﻿namespace CSharpPro._0922;

public class Demo
{
    public void TestPrint()
    {
        //判断闰年
        //1.能被4整除，并且不能被100整除
        //2.能被400整除
        
        Console.Write("请输入年份:");
        int year = int.Parse(Console.ReadLine());
        bool isleapYear = (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0) ;
        if (isleapYear)
        {
            Console.WriteLine($"{year}年是闰年");
        }
        else
        {
            Console.WriteLine($"{year}年不是闰年");
        }
        
    }
}